#!/usr/bin/env python
# The intermecdiate lexicon is necessary to generate before applying the post lexical rules.
# This module replaces the entries in the basic lexicon, with the entries in the exceptions
# lists.

import get_exceptions
import config
import dicts




# Much like my get_exceptions module, the below code works fine,
# but I will have to repeat much of this function in every other function
# I'll write for the module.  Maybe that's the path of least resistance,
# but I smell classes.  This can be more effecient. 


def get_guk_inter():
    with open(config.PATH_TO_UNILEX) as f:
        unilex = f.readlines()
        guk_ex = get_exceptions.get_guk_exceptions()
        ex_words = [line.split(':', 1)[0] for line in guk_ex]
        for entry in unilex:
            if entry.split(':', 1)[0] in ex_words:
                unused = unilex.index(entry)
                unilex.pop(unused)
                guk_inter = guk_ex + unilex
                return guk_inter


def main(): 
    guk_inter = get_guk_inter()    
    

if __name__ == 'main':
    main()
